<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('邀请员工')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="container">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-roster-invite">
            <div class="form-group">
                <label class="col-sm-3 control-label">姓名
                    ：</label>
                <div class="col-sm-8">
                    <input name="fullName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">手机
                    ：</label>
                <div class="col-sm-8">
                    <input name="mobilePhone" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">邮箱
                    ：</label>
                <div class="col-sm-8">
                    <input name="email" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = "/ry/system/roster"
    $("#form-roster-invite").validate({
        focusCleanup: true,
        rules: {
            mobilePhone: {
                required: true,
                isPhone: true
            }
        }
    });
    //提交
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.post(prefix + "/saveInvite", $('#form-roster-invite').serialize(),(r) => {
                if(r.code == 0){
                    $.modal.msgSuccess("邀请成功!");
                    setTimeout(
                        () => {
                            $.modal.close();
                        },2000
                    );
                }else{
                    $.modal.alertError(r.message);
                }
            });
        }
    }
</script>
</body>
</html>